import {getCache, setCache, removeCache} from './cache'

const TokenKey = 'user'

export function getUser() {
  let app = getCache(TokenKey)
  if(app)return JSON.parse(app)
  return {}
}

export function setUser(token) {
  return setCache(TokenKey, JSON.stringify(token))
}

export function removeUser() {
  return removeCache(TokenKey)
}
